-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom compiler crash/panic handler #731
base: master
Are you sure you want to change the base?
Custom compiler crash/panic handler #731
Conversation
… report with Information about : OS, JVM, a full stacktrace . Additionally, the crash report is written into a log file
… in effektVersion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I think there are some design/layout choices that we could discuss (e.g. emitting markdown for copy/pasting to GitHub), but otherwise this looks like a good initial implementation.
We should also make sure that things like the System.getProperty
calls work on all platforms (including Windows!)
added correct Effekt Version
…piler/verbose-crash # Conflicts: # effekt/jvm/src/main/scala/effekt/Driver.scala
Hey:) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @JakubSchwenkbeck, this seems like a great first draft.
Please take a look at my comments below to guide the next steps! :)
Could you please post the current version of the generated report here, please? :) |
I'm flexible with the design, changing the layout / contet only needs minor String-manipulations, so feel free to knitpick:) |
Note
Working:case e @ CompilerPanic(msg) =>
context.report(msg)
generateCrashReport(e, context, config, msg) NOT Working:case e @ CompilerPanic(msg) => generateCrashReport(e, context, config, msg) |
Resolves the `Effect Compiler Crash: null` part of #760. The actual problem there was that `e.getMessage` can return `null` and it does for... _StackOverflowException_ 🥳. Looking at the docs, it's recommended to use `e.toString`. While I was at it, I modified stack trace printing, now we do it properly by using `.printStackTrace`. This is very related to #731, I just want to get this out quickly to unblock other problems.
Hey @jiribenes , @marvinborner :) I would be happy to receive some input (/approval) regarding the design of both the terminal and the markdown report:) Examples for both are found in the opening message of this PR! |
Resolves the `Effect Compiler Crash: null` part of #760. The actual problem there was that `e.getMessage` can return `null` and it does for... _StackOverflowException_ 🥳. Looking at the docs, it's recommended to use `e.toString`. While I was at it, I modified stack trace printing, now we do it properly by using `.printStackTrace`. This is very related to #731, I just want to get this out quickly to unblock other problems.
Resolves the `Effect Compiler Crash: null` part of effekt-lang#760. The actual problem there was that `e.getMessage` can return `null` and it does for... _StackOverflowException_ 🥳. Looking at the docs, it's recommended to use `e.toString`. While I was at it, I modified stack trace printing, now we do it properly by using `.printStackTrace`. This is very related to effekt-lang#731, I just want to get this out quickly to unblock other problems.
Motivation
Print and log a more verbose compiler crash/panic message with information about the specific user setup
Resolves #576.
Changes
Implemented the
generateCrashReport
function, which creates a more verbose output if the compiler crashes/panics.This Report retrieves general and backend-specific information to make crashes more reproducable or traceable
It holds information about :
Additionally, the report is written to a
.md
-file in the .out/ directoryExamples:
Terminal Report
Markdown Report
Effekt Compiler Crash Report
ERROR : Internal compiler error: Error Text here bla bla
The compiler unexpectedly panicked. This is a compiler bug.
Please report it: Submit an issue
Compiler Information
Effekt Version: 0.13.0
Backend: js
System Information
Operating System: Linux
Arch: amd64
Version: 5.15.167.4-microsoft-standard-WSL2
JVM Version: 21.0.5 (Ubuntu, OpenJDK Runtime Environment)
Full Stack Trace
Arguments Passed to the Compiler